package com.cqhilink.iot.jobstandardmanagement.services.innerservice;

import org.springframework.context.ApplicationContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;

/**
 * Created by Administrator on 2016/12/8.
 */
public interface JsmUploadService {
    /**
     * @param request
     * @param filename 文件名称
     * @return
     * @throws Exception
     */
    String[] uploadImg(HttpServletRequest request, String filename) throws Exception;

    /**
     * @param request
     * @param input
     * @return
     * @throws Exception
     */
    String[] uploadImg(HttpServletRequest request, InputStream input) throws Exception;

    /**
     *
     * @param request
     * @param response
     * @param imageName 文件名称
     * @param tableName
     * @throws Exception
     */
    void getImg(HttpServletRequest request, HttpServletResponse response, String imageName, String tableName) throws Exception;

    /**
     * @param request
     * @param filename
     * @return
     * @throws Exception
     */
    String[] uploadFile(HttpServletRequest request, String filename) throws Exception;

    /**
     * 上传图片或文件
     *
     * @param filename
     * @param request
     * @modify by jiangjx on 2017年1月6日 16:00:23 增加注释
     */
    String[] uploadImgOrFile(HttpServletRequest request, String filename) throws Exception;

    /**
     * 预览图片或文件
     *
     * @param request
     * @param response
     * @param fileHbasePath
     * @param tablename
     */
    void getImgOrFile(HttpServletRequest request, HttpServletResponse response, String fileHbasePath, String tablename) throws Exception;


    /**
     * 上传二进制流
     * @param suffix
     * @param request
     * @param images
     * @return
     * @throws Exception
     */
   String[] uploadByte(String suffix,HttpServletRequest request,byte[] images) throws Exception;


    /**
     * 上传文件
     * @param suffix
     * @param applicationContext
     * @param images
     * @return
     * @throws Exception
     */
    String[] uploadByte(String suffix, byte[] images, ApplicationContext applicationContext) throws Exception;

}
